var app = new Vue({
    el: "#app",

    // delimiters: ['[[', ']]'],  // 声明Vue使用的模板变量语法
    data: {

        username: sessionStorage.username || localStorage.username,
        user_id: sessionStorage.user_id || localStorage.user_id,
        token: sessionStorage.token || localStorage.token,
        spits: null

    },
    mounted: function () {
        // 一加载就需要做的，直接是代码
        axios.get(HOST + "/spits/")
            .then(response => {
                this.spits = response.data
                // console.log(response.data["results"])
            });
    },
    methods: {
        // 需要用到的函数，键值对 ，键是名称，值是匿名函数
         logout: function(){
            var url= window.location.href
             sessionStorage.clear();
             localStorage.clear();
             location.href = url;
        },
    },
    computed: {
        // 需要通过计算得到的数据，键值对 ，键是名称，值是匿名函数
    }
});